package primary.String;

/**
 * @Author Elephas
 * @Date 2022/1/7
 **/
public class ReverseString {
    /*
        头尾对应元素一一交换
     */
    public void reverseString(char[] s){
        for (int i = 0; i < s.length/2; i++) {
            char temp = s[i];
            s[i] = s[s.length-i-1];
            s[s.length-i-1] = temp;
        }
    }
}
